from flask import request, session, current_app
    
class Form():
    
    def __init__(self):
        self.request = request
    
    def is_submitted(self):
        """
        Checks if form has been submitted. The default case is if the HTTP
        method is **PUT** or **POST**. 
        
        The POST request method is designed to accept data in the request message, often used when 
        uploading or submitting a web form.
        
        The GET request method is designed to retrieve information from the server
        """
        return request and request.method in ("PUT", "POST")
 
    def get_raw_inputs(self):
        """Get raw inputs from the form, group into a map and return this map.
        """
        values = {}
        for key in request.values:
            values[key] = request.values[key]
        return values
